define(function(require){
	var $=require("jq.js");
	var idNames = ["J_LoadContent","zixun-content"];
	var contentWrap = null;
	for(var i=0;i<idNames.length;i++){
		contentWrap = $("#"+idNames[i]);
		if(contentWrap.length>0){
			break;
		}
	}
	var id = contentWrap.attr("data-id");
	var url = "/upload/content/"+id%100+"/"+id+".htm?random="+Math.random();	
	
	/*	$.post(url,function(html){
		html = html.replace(/(<\s*?img.*? src)(=.*?>)/gim,"$1='/pinzhiV2.0/images/replace400.jpg' data-source$2");   
		contentWrap.html(html);
		require("/pinzhiV2.0/js/pz-lazyLoad.js");
	},"html");*/
	
	//标准浏览器通过CORS技术加载不同源数据
	
	var version = window.navigator.userAgent,
		ie6     = /MSIE\s*6\.0/gi.test(version),
		ie7     = /MSIE\s*7\.0/gi.test(version),
		opear   = /OPR/gi.test(version);
	//替换代码为绝对路径http://img.pinzhi365.com
	var replaceTxt = function(html){
		if(/\/send\.redir/gim.test(html)){
			html = html.replace(/\/send\.redir.*?url=/gim,"");
			html = html.replace(/(<\s*?img.*? src)=(['|"])(.*?>)/gim,"$1='/pinzhiV2.0/images/replace400.jpg' data-source=$2http://img.pinzhi365.com$3");
		}else{
			html = html.replace(/(<\s*?img.*? src)=(['|"])(.*?>)/gim,"$1='/pinzhiV2.0/images/replace400.jpg' data-source=$2http://img.pinzhi365.com$3");
		};
		return html;
	};
	
	if(ie6||ie7||opear){
		//处理下url
		//url = "http://www.pinzhi365.com"+url;
		$.get(url,function(html){
			contentWrap.html(replaceTxt(html));
			require("/pinzhiV2.0/js/pz-lazyLoad.js");
		},"html");
	}else{
		var createCORSRequest = function(method, url) {
			  var xhr = new XMLHttpRequest();
			  if ("withCredentials" in xhr) {
			    // 针对Chrome/Safari/Firefox.
			    xhr.open(method, url, true);
			  } else if (typeof XDomainRequest != "undefined") {
			    // 针对IE
			    xhr = new XDomainRequest();
			    xhr.open(method, url);
			  } else {
			    // 不支持CORS
			    xhr = null;
			  };
			  return xhr;
			};
			 
			// 发送CORS请求
			function makeCorsRequest(url,callBack) {
			 
			  var xhr = createCORSRequest('GET', url);
			  if (!xhr) {
			    console.log('CORS not supported');
			    return;
			  };
			 
			  // 回应处理
			  xhr.onload = function() {
			    var text = xhr.responseText;
			    callBack(text);
			  };
			 
			  xhr.onerror = function() {
			    console.log('Woops, there was an error making the request.');
			  };
			 
			  xhr.send();
			};
			//处理一下Url
			url = "http://img.pinzhi365.com"+url;
			makeCorsRequest(url,function(html){
				contentWrap.html(replaceTxt(html));
				require("/pinzhiV2.0/js/pz-lazyLoad.js");
			});
	};

});